---
title: "ReadMe"
output:
  pdf_document: default
  html_document:
    df_print: paged
date: "2024-10-04"
geometry: margin=1in
fontsize: 11pt
---

This repository contains R scripts and data to replicate the results from the article, "Resistance and Repression: How Do Rebels Respond to Civilian Self-Protection Strategies in War Zones?".

These replication materials are organized in five compressed folders:

### 1. Main Analysis ###

This folder includes the main dataset and the R script to replicate the main models discussed in the study. It also saves the results of these models.

If it is necessary to replicate all the steps to prepare the main dataset, you can use the R scripts, raw datasets, and transformed datasets from the folder, "5. Data".

### 2. Main Results - Tables & Figures ###

This folder includes the R script to prepare Figures 1-4 and Tables 2-3 of the article.

### 3. Robustness Checks ###

This folder contains the individual R scripts for the preparation of the three robustness checks of the article, as well as the code to replicate Figures 5-8 of the Appendix.

### 4. Diagnostics ###

This folder contains the individual R script for the preparation of the diagnostics of the main models of the article, as well as the code to replicate Figures 9 and 10 of the Appendix.

### 5. Data ###

Use these R scripts and datasets to replicate the main dataset of the study.

There is an individual folder for each kind of variable in the dataset: CV, IV, and DV.

The transformed datasets and the R script to merge the three kinds of variables can also be accessed in this folder. Two raw datasets are not available because they are restricted by the source that shared them with me. 

Specifically, I use the following raw datasets:

#### 5.1 Control Variables ####
  
  - CEDE_CaracteristicasGenerales.dta
    Note: This file is not available because it is restricted by CEDE.
  - DANE-PopulationMunicipality_AreaSexAge(1985-1994).xlsx
  - DANE-PopulationMunicipality_AreaSexAge(1995-2004).xlsx
  - DANE-PopulationMunicipality_AreaSexAge(2005-2017).xlsx
  - verdata-reclutamiento-R1.csv
  - VIVIENDAS.dta
    Note: This file is not available because it is restricted by CEDE.
    
Bibliography in the order of the list:

Acevedo, K., & Bornacelly, I. (2014). Panel Municipal del CEDE, Documentos CEDE 012223, Universidad de los Andes. 

DANE. (2023). Proyecciones y retroproyecciones de población municipal para el periodo 1985-2019 y 2020-2035 con base en el CNPV 2018. Banco Nacional de Datos, DANE.  Available at: https://www.dane.gov.co/index.php/estadisticas-por-tema/demografia-y-poblacion/proyecciones-de-poblacion. 

CEV – JEP – HRDAG. (2023). Integración de Datos y Estimación Estadística de Víctimas en el Marco del Conflicto Armado. Reclutamiento. Available at: https://microdatos.dane.gov.co/index.php/catalog/795/get-microdata  

DANE. (1986). Colombia. Censo Nacional de 1985. Cuadros de Población Total con Ajuste Final de Cobertura por Secciones del País y Municipios. Banco Nacional de Datos, DANE. 
    
##### 5.1.1 CEDAE - Pre Processing #####

  - 1984_Concejo.dta
  - 1986_Concejo.dta
  - 1990_Concejo.dta
  - 1992_Concejo.dta
  - 1994_Concejo.dta
  - 1997_Concejo.dta
  - 2000_Concejo.dta
  - 2003_Concejo.dta
  
Bibliography:

Centro de Estudios en Democracia y Asuntos Electorales (CEDAE). (2024). Resultados Electorales. Concejo (1984, 1986, 1990, 1992, 1994, 1997, 2000, 2003). Available at: https://cedae.datasketch.co/datos-democracia/resultados-electorales/descarga-los-datos/.  

##### 5.1.12 OMC - Pre Processing - Updated #####

 - CasosAB_202309.xlsx
 - CasosAP_202309.xlsx
 - CasosAS_202309.xlsx
 - CasosAT_202309.xlsx
 - CasosDB_202309.xlsx
 - CasosDF_202309.xlsx
 - CasosMA_202309.xlsx
 - CasosMI_202309.xlsx
 - CasosRU_202309.xlsx
 - CasosSE_202309.xlsx
 - CasosVS_202309.xlsx
 - VictimasAB_202309.xlsx
 - VictimasAP_202309.xlsx
 - VictimasAS_202309.xlsx
 - VictimasAT_202309.xlsx
 - VictimasDB_202309.xlsx
 - VictimasDF_202309.xlsx
 - VictimasMA_202309.xlsx
 - VictimasMI_202309.xlsx
 - VictimasRU_202309.xlsx
 - VictimasSE_202309.xlsx
 - VictimasVS_202309.xlsx

Bibliography:

Centro Nacional de Memoria Histórica (CNMH). (2023). Bases de datos. Observatorio de Memoria y Conflicto. Available at: http://micrositios.centrodememoriahistorica.gov.co/observatorio/portal-de-datos/el-conflicto-en-cifras/#base-de-datos. 

#### 5.2 Independent Variables ####

 - Ortega(2022)-ODAW_v1.1.xlsx
 - ViPPA_v1_2.dta
 
Bibliography:

Ortega, P. (2022). A Theory on the Rise and Fall of Resistance in Civil Wars. Ph.D. Thesis. Arizona State University. 

Osorio, J., Mohamed M., Pavon, V., & Brewer-Osorio, S. (2019). Mapping Violent Presence of Armed Actors in Colombia. Advances of Cartography and GIScience of the International Cartographic Association, 1(16): 1-9.

#### 5.3 Dependent Variables ####

 - VictimasAS_202309.xlsx
 - VictimasMA_202309.xlsx
 
Bibliography:

Centro Nacional de Memoria Histórica (CNMH). (2023). Bases de datos. Observatorio de Memoria y Conflicto. Available at: http://micrositios.centrodememoriahistorica.gov.co/observatorio/portal-de-datos/el-conflicto-en-cifras/#base-de-datos. 

In addition, to the files in these folders, I also use data on civilians killed by FARC, according to the Human Rights Observatory of the Presidency of Colombia (Weintraub 2016).

 - Weintraub(2016)-Replication.csv

Bibliography:

Weintraub, M. (2016). Do All Good Things Go Together? Development Assistance and Insurgent Violence in Civil War. The Journal of Politics, 78(4), 989-1002.

### Session Information ###

R version 4.4.1 (2024-06-14)
Platform: x86_64-apple-darwin20
Running under: macOS Sonoma 14.7

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.4-x86_64/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: America/Chicago
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] PanelMatch_2.2.0   writexl_1.5.0      readxl_1.4.3       foreign_0.8-86    
 [5] readstata13_0.10.1 lubridate_1.9.3    forcats_1.0.0      stringr_1.5.1     
 [9] dplyr_1.1.4        purrr_1.0.2        readr_2.1.5        tidyr_1.3.1       
[13] tibble_3.2.1       ggplot2_3.5.1      tidyverse_2.0.0   

loaded via a namespace (and not attached):
 [1] shape_1.4.6.1       gtable_0.3.5        xfun_0.47           bslib_0.8.0        
 [5] MatchIt_4.5.5       lattice_0.22-6      numDeriv_2016.8-1.1 tzdb_0.4.0         
 [9] vctrs_0.6.5         tools_4.4.1         generics_0.1.3      parallel_4.4.1     
[13] fansi_1.0.6         pkgconfig_2.0.3     Matrix_1.7-0        data.table_1.15.4  
[17] CBPS_0.23           lifecycle_1.0.4     compiler_4.4.1      tinytex_0.52       
[21] munsell_0.5.1       codetools_0.2-20    htmltools_0.5.8.1   sass_0.4.9         
[25] yaml_2.3.10         glmnet_4.1-8        pillar_1.9.0        crayon_1.5.3       
[29] jquerylib_0.1.4     MASS_7.3-60.2       cachem_1.1.0        iterators_1.0.14   
[33] foreach_1.5.2       tidyselect_1.2.1    digest_0.6.37       stringi_1.8.4      
[37] splines_4.4.1       fastmap_1.2.0       grid_4.4.1          colorspace_2.1-1   
[41] cli_3.6.3           magrittr_2.0.3      survival_3.6-4      utf8_1.2.4         
[45] withr_3.0.1         scales_1.3.0        backports_1.5.0     bit64_4.0.5        
[49] timechange_0.3.0    rmarkdown_2.28      nnet_7.3-19         bit_4.0.5          
[53] cellranger_1.1.0    hms_1.1.3           evaluate_0.24.0     knitr_1.48         
[57] rlang_1.1.4         Rcpp_1.0.13         glue_1.7.0          rstudioapi_0.16.0  
[61] vroom_1.6.5         jsonlite_1.8.8      R6_2.5.1           

R version 4.4.1 (2024-06-14) -- "Race for Your Life"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin20

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it